home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////
- // ObjectEditor
- // by Charles Lloyd
- ////////////////////////
-
- ///////////////////
- // User Options
- ///////////////////
- id labelArray;
- id keyArray;
- id targetObject;
-
- id borderSize;
- id cellPadding;
- id cellSpacing;
- id fieldSize;
- id isEditable;
-
- ////////////////////
- // Internal State
- ////////////////////
- id valueArray;
- id valueDictionary;
-
- id entryCount;
- id rowIndex;
-
- id labelString;
- id valueString;
-
-
- - awake
- {
- borderSize = 1;
- cellSpacing = 0;
- cellPadding = 0;
- fieldSize = 15;
- rowIndex = 0;
- isEditable = NO;
- }
-
- - setLabelArray:anArray
- {
- labelArray = anArray;
- entryCount = [labelArray count];
- }
-
- - labelString
- {
- return [labelArray objectAtIndex:rowIndex];
- }
-
- - valueString
- {
- id aKey = [keyArray objectAtIndex:rowIndex];
- id aDict = [targetObject valuesForKeys:keyArray];
- id aValue = [aDict objectForKey:aKey];
- return aValue;
- }
-
- - setValueString:aValue
- {
- id aDict;
- id aKey;
- if (!aValue) {
- return nil;
- }
- aDict = [NSMutableDictionary dictionary];
- aKey = [keyArray objectAtIndex:rowIndex];
- [aDict setObject:aValue forKey:aKey];
- [targetObject takeValuesFromDictionary:aDict];
- }
-